# -*- coding: utf-8 -*-
from flask_security import current_user
from flask_admin import Admin, AdminIndexView, expose, BaseView
from flask import Flask, url_for, redirect, render_template, request, session
from sqlalchemy import func, or_
from adminApp.extensions import db
# from adminApp.models import Account, Customer, Allocation
from flask_security import current_user
from datetime import datetime, timedelta


class MyAdminIndexView(AdminIndexView):
    # @expose()
    @expose('/', methods=['GET', 'POST'])
    def index(self):
        if not current_user.is_authenticated:
            return redirect(url_for('security.login'))
        userid = current_user.id

        return self.render(self._template)

        # return self.render('myadmin/my_index.html')
